Standard memory functions.
Allocates a requested amount of memory.
The number of bytes to allocate
A pointer to the allocated memory or NULL on error.
Allocates space for count objects that are size bytes and fills the memory with bytes of value 0.
The number of objects to allocate space for
The size of the object type being allocated
A pointer to the allocated memory or NULL on error.
Takes the memory allocated at ptr and changes the length of its allocation to the size specified.
Copies the smaller of the length of the original allocation or the new size into the newly allocated buffer.
The memory allocation to be changed
The size to change the ptr allocation to
A pointer to the new allocated memory or NULL on error
Frees previously allocated memory.
The memory buffer to free.
Compares the first n bytes of memory regions ptr1 and ptr2.
The pointer to the first memory region to compare
The pointer to the second memory region to compare
The number of bytes to compare
0 if the first n bytes of ptr1 and ptr 2 match. Otherwise, the sign is determined by the sign of the difference between the first pair of bytes that differ in ptr1 and ptr2.
Copies n bytes from src to dest.
The pointer to the destination memory region
The pointer to the source memory region
The number of bytes to copy
Copies n bytes from src to dest by first copying to a temporary area first, allowing dest and src to potentially overlap.
This can be used to move data to a location that overlaps its previous location.
The pointer to the destination memory region
The pointer to the source memory region
The number of bytes to copy
Sets n bytes to c starting at dest.
This can be used to clear a memory region for example if c is 0.
The pointer to the destination memory region
The integer used as an unsigned char to assign to each byte
The number of bytes to set
size as an unsigned integer
Do you have questions about the Pebble SDK?
Do you need some help understanding something on this page?
You can either take advantage of our awesome developer community and check out the SDK Help forums, or you can send us a message through the website!