Home | History | Annotate | Download | only in stub
      1 /* Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
      2  * Use of this source code is governed by a BSD-style license that can be
      3  * found in the LICENSE file.
      4  *
      5  * Workaround for TODO(crbug.com/437107). Remove this file when it's fixed.
      6  */
      7 
      8 #define _STUB_IMPLEMENTATION_
      9 
     10 #include <stdio.h>
     11 #include <stdlib.h>
     12 
     13 #include "vboot_api.h"
     14 
     15 void *VbExMalloc(size_t size)
     16 {
     17 	void *p = malloc(size);
     18 
     19 	if (!p) {
     20 		/* Fatal Error. We must abort. */
     21 		abort();
     22 	}
     23 
     24 	return p;
     25 }
     26 void VbExFree(void *ptr)
     27 {
     28 	free(ptr);
     29 }
     30 
     31 
     32 /*
     33  * This file should be used only when building the static version of futility,
     34  * so let's intentionally break any tests that link with it by accident.
     35  */
     36 int vboot_api_stub_check_memory(void)
     37 {
     38 	return -1;
     39 }
     40