Lines Matching refs:ptr
45 void *ptr = NULL;
52 ptr = LOS_KernelMalloc((UINT32) real_size);
53 if (ptr != NULL) {
54 (void) memset_s((void *) ptr, real_size, 0, real_size);
56 return ptr;
61 * realloc. The argument ptr points to the space that was previously allocated.
62 * If ptr points to a memory block that was not allocated with calloc, malloc,
66 void free(void *ptr)
68 if (ptr == NULL) {
72 LOS_KernelFree(ptr);
91 void *ptr = NULL;
97 ptr = LOS_KernelMalloc((UINT32) size);
98 if (ptr != NULL) {
99 (void) memset_s(ptr, size, 0, size);
101 return ptr;
119 * Attempts to resize the memory block pointed to by ptr that was previously
120 * allocated with a call to malloc or calloc. The contents pointed to by ptr are
124 * bytes at the end of the block are freed. If ptr is null, then it behaves like
125 * malloc. If ptr points to a memory block that was not allocated with calloc
128 * to by ptr are unchanged. If size is zero, then the memory block is completely
132 void *realloc(void *ptr, size_t size)
134 if (ptr == NULL) {
135 ptr = malloc(size);
136 return ptr;
140 free(ptr);
144 return LOS_KernelRealloc(ptr, (UINT32) size);