bin/varnishd/cache/cache_vrt.c
VCL_BLOB
VRT_blob(VRT_CTX, const char *err, const void *src, size_t len, unsigned type)
{
	struct vrt_blob *p;

	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
	CHECK_OBJ_NOTNULL(ctx->ws, WS_MAGIC);

	if (src == NULL || len == 0)
		return (vrt_null_blob);

	p = (void *)WS_Alloc(ctx->ws, sizeof *p);
	if (p == NULL) {
		VRT_fail(ctx, "Workspace overflow (%s)", err);
		return (NULL);
	}

	p->type = type;
	p->len = len;
	p->blob = src;

	return (p);
}
/*
 * the pointer passed as src must have at least VCL_TASK lifetime
 */
the pointer passed as src must have at least VCL_TASK lifetime
the pointer passed as src must have at least VCL_TASK lifetime
VCL_BLOB
VRT_blob(VRT_CTX, const char *err, const void *src, size_t len, unsigned type)
{
	struct vrt_blob *p;
	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
	CHECK_OBJ_NOTNULL(ctx->ws, WS_MAGIC);
	if (src == NULL || len == 0)
		return (vrt_null_blob);
	p = (void *)WS_Alloc(ctx->ws, sizeof *p);
	if (p == NULL) {
		VRT_fail(ctx, "Workspace overflow (%s)", err);
		return (NULL);
	}
	p->type = type;
	p->len = len;
	p->blob = src;
	return (p);
}
VCL_BLOB VRT_blob ( VRT_CTX , const char * err , const void * src , size_t len , unsigned type ) { struct vrt_blob * p ; CHECK_OBJ_NOTNULL ( ctx , VRT_CTX_MAGIC ) ; CHECK_OBJ_NOTNULL ( ctx -> ws , WS_MAGIC ) ; if ( src == NULL || len == 0 ) return ( vrt_null_blob ) ; p = ( void * ) WS_Alloc ( ctx -> ws , sizeof * p ) ; if ( p == NULL ) { VRT_fail ( ctx , " " , err ) ; return ( NULL ) ; } p -> type = type ; p -> len = len ; p -> blob = src ; return ( p ) ; }
the pointer passed as src must have at least VCL_TASK lifetime
the pointer passed as src must have at least VCL_TASK lifetime