swh:1:snp:77163734605b0ec556b01d897b7bb4a7e30d46b6
Raw File
Tip revision: d13937116f1e82bf508a6325111b322c30c85eb9 authored by Linus Torvalds on 10 February 2019, 22:42:20 UTC
Linux 5.0-rc6
Tip revision: d139371
alloc.c
// SPDX-License-Identifier: GPL-2.0
#include <linux/types.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/memblock.h>
#include <linux/string.h>
#include <asm/setup.h>


void * __ref zalloc_maybe_bootmem(size_t size, gfp_t mask)
{
	void *p;

	if (slab_is_available())
		p = kzalloc(size, mask);
	else {
		p = memblock_alloc(size, SMP_CACHE_BYTES);
	}
	return p;
}
back to top