mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-23 15:49:23 +00:00
realloc
This commit is contained in:
1 parent
23a2f35a0b
commit
7c8f178d02
2 files changed
+27
-7
No files matched your search
@@ -80,6 +80,25 @@ grub_relocator32_alloc (grub_size_t size)
|
||||
return playground + RELOCATOR_SIZEOF (forward);
|
||||
}
|
||||
|
||||
void *
|
||||
grub_relocator32_realloc (void *relocator, grub_size_t size)
|
||||
{
|
||||
char *playground;
|
||||
|
||||
playground = (char *) relocator - RELOCATOR_SIZEOF (forward);
|
||||
|
||||
playground = grub_realloc (playground,
|
||||
(RELOCATOR_SIZEOF (forward) + RELOCATOR_ALIGN)
|
||||
+ size
|
||||
+ (RELOCATOR_SIZEOF (backward) + RELOCATOR_ALIGN));
|
||||
if (!playground)
|
||||
return 0;
|
||||
|
||||
*(grub_size_t *) playground = size;
|
||||
|
||||
return playground + RELOCATOR_SIZEOF (forward);
|
||||
}
|
||||
|
||||
void
|
||||
grub_relocator32_free (void *relocator)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user