mirror of https://bitbucket.org/ausocean/av.git
rtmp: remove incorrect and redundant calloc implementation
This commit is contained in:
parent
f237b5453e
commit
66cdea021c
|
@ -200,7 +200,7 @@ func C_RTMPPacket_Alloc(p *C_RTMPPacket, nSize uint32) (ok bool) {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
ptr = (*byte)(calloc(1, uintptr(nSize+RTMP_MAX_HEADER_SIZE)))
|
ptr = (*byte)(malloc(uintptr(nSize + RTMP_MAX_HEADER_SIZE)))
|
||||||
|
|
||||||
if ptr == nil {
|
if ptr == nil {
|
||||||
return false
|
return false
|
||||||
|
@ -2110,12 +2110,6 @@ func malloc(nOfBytes uintptr) unsafe.Pointer {
|
||||||
return unsafe.Pointer(&mem[0])
|
return unsafe.Pointer(&mem[0])
|
||||||
}
|
}
|
||||||
|
|
||||||
func calloc(val byte, noOfBytes uintptr) unsafe.Pointer {
|
|
||||||
mem := malloc(noOfBytes)
|
|
||||||
memset((*byte)(mem), val, int(noOfBytes))
|
|
||||||
return mem
|
|
||||||
}
|
|
||||||
|
|
||||||
// incBytePtr returns an unsafe.Pointer to a byte that is inc positive positions
|
// incBytePtr returns an unsafe.Pointer to a byte that is inc positive positions
|
||||||
// from the passed ptr
|
// from the passed ptr
|
||||||
func incBytePtr(ptr unsafe.Pointer, inc int) unsafe.Pointer {
|
func incBytePtr(ptr unsafe.Pointer, inc int) unsafe.Pointer {
|
||||||
|
|
Loading…
Reference in New Issue